<?php

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
 */

Route::post('account/login', 'AccountController@login');

Route::post('account/logout', 'AccountController@logout');

Route::group(['middleware' => 'auth:admin'], function () {

	// 账户
	Route::get('account/show', 'AccountController@show');

	// 用户
	route_resource('users','UsersController');

	// 游戏
	Route::get('games', 'GamesController@index');

	// 积分赛
	route_resource('integrals','IntegralsController');

	// 联赛
	route_resource('tournaments','TournamentsController');

	// 新闻
	route_resource('news','NewsController');

	// 商品
    route_resource('goods','GoodsController');

	// 目录
    route_resource('categories','CategoriesController');

	// 上传图片
    Route::post('upload/image', 'UploadController@image');
});